package com.ruoyi.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class DurationUtil {

    public final static SimpleDateFormat FORMATTER = new SimpleDateFormat("HH:mm:ss");

    static {
        FORMATTER.setTimeZone(TimeZone.getTimeZone("GMT+0:00"));
    }

    /**
     * 秒格式化成  HH:mm:ss
     *
     * @param second
     * @return
     */
    public static String format(long second) {
        return FORMATTER.format(new Date(second * 1000));
    }

    public static void main(String[] args) {
        System.out.println(format(100));
    }
}
